package service.impl;
import java.util.List;

import dao.UserInfoMapper;
import model.UserInfo;
import service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 创建时间：2015-1-27 下午5:22:59
 *
 * @version 2.2
 */
@Service("userService")
public class UserServiceImpl implements UserService {

    @Autowired
    private UserInfoMapper userInfoMapper;

    @Override
    public UserInfo getUserById(int id) {
        return userInfoMapper.selectByPrimaryKey(id);
    }
    @Override
    public UserInfo selectByName(String uname){
        return userInfoMapper.selectByName(uname);
    }
    @Override
    public List<UserInfo> getUsers() {
        return userInfoMapper.selectAll();
    }

    @Override
    public int insert(UserInfo userInfo) {

        int result = userInfoMapper.insert(userInfo);

        System.out.println(result);
        return result;
    }

}